package com.wisdytech.cloud.controller;

import com.wisdytech.cloud.service.FeignService;
import com.wisdytech.cloud.service.MesWmsService;
import com.wisdytech.linkmes.common.MultiResultResponse;
import com.wisdytech.linkmes.wms.api.basic.dto.MaterialCategoryQueryDto;
import com.wisdytech.linkmes.wms.api.basic.vo.MaterialCategoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Gemini
 * com.wisdytech.cloud.controller.FeignTestController
 *
 * @author hailin.zhl
 * @date 2018/10/23
 */
@RestController
public class FeignTestController {

    @Autowired
    FeignService feignService;

    @Autowired
    MesWmsService mesWmsService;

    @GetMapping(value = "/hi")
    public MultiResultResponse<MaterialCategoryVo> test(String name) {
        MaterialCategoryQueryDto queryDto = new MaterialCategoryQueryDto();
        queryDto.setCategoryCode("ceshi1");
        return mesWmsService.getMaterialCategory(queryDto,0,1);
    }

    @GetMapping(value = "/hi1")
    public String test1(String name) {
        return feignService.sayHiFromClientOne("kaga1");
    }
}
